package zhai.git.test;

import org.openjdk.jol.info.ClassLayout;

import java.util.Arrays;

public class Sort {

    public static void main(String[] args) {
        Object o = new Object();
        System.out.println(ClassLayout.parseInstance(o).toPrintable());
        synchronized(o) {
            System.out.println(ClassLayout.parseInstance(o).toPrintable());
        }
    }

    public static int[] sort(int[] arrays) {
        for (int i = 0; i < arrays.length; i++) {
            for (int j = 0; j < arrays.length - 1 - i; j++) {
                if (arrays[j] > arrays[j+1]) {
                    int a = 0;
                    a = arrays[j];
                    arrays[j] = arrays[j+1];
                    arrays[j+1] = a;
                }
            }
        }
        return arrays;
    }
}
